
function request(porams,pase=false){
    return new Promise((resolve,reject)=>{
        wx.showLoading({
          
          title: '正在加载中',
        })
        wx.request({
        ...porams,
        url:'http://139.224.104.64:5000'+porams.url,
          success:(res)=>{
           
            if(pase){
              resolve({
                list:res.data,
                 tatal:res.header['X-Total-Count']
              })

            }else{
                 resolve(res.data)
              }
             
          },
          fail:(err)=>{
            reject(err)
          },
          complete:()=>{
              wx.hideLoading({
                success: (res) => {},
              })
          }
        })
    })
}

module.exports=request